package com.tql.mall.order.client;


import com.tql.mall.model.order.OrderInfo;
import com.tql.mall.order.client.impl.OrderDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * @Author: tyk
 * @Date: 2023/5/26 16:44
 * @Description:
 */
@FeignClient(value = "service-order", fallback = OrderDegradeFeignClient.class)
public interface OrderFeignClient {
    /**
     * 订单页面需要数据
     */
    @GetMapping("api/order/inner/trade")
    Map<String, Object> trade();

    /**
     * 根据订单ID查询订单信息
     */
    @GetMapping("api/order/inner/getOrderInfo/{orderId}")
    OrderInfo getOrderInfo(@PathVariable Long orderId);

    /**
     * 修改订单状态
     */
    @GetMapping("api/order/inner/updateOrderStatus/{orderId}/{flag}")
    void updateOrderStatus(@PathVariable Long orderId, @PathVariable Integer flag);

}
